package cn.hill4j.tool.spring.std.ds.controller;

import cn.hill4j.tool.spring.std.ds.common.ITxService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * TODO Description
 *
 * @author: hillchen
 * Date: 2022-08-08 16:12
 */
@RestController
public class TxTestController {
    @Resource
    private ITxService txService;
    @GetMapping("/saveByName/{name}")
    public boolean saveByName(@PathVariable("name") String name){
        txService.saveUserAndCustomer(name);
        return true;
    }
    @GetMapping("/save2UserByName/{name}")
    public boolean save2User(@PathVariable("name") String name){
        txService.save2User(name);
        return true;
    }

    @GetMapping("/save2CustomerAndFindUser/{name}")
    public boolean save2CustomerAndFindUser(@PathVariable("name") String name){
        txService.save2CustomerAndFindUser(name);
        return true;
    }

}
